package com.kdzy.lshy.socity_server.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.kdzy.lshy.socity_server.service.ResidencePermitService;

import io.swagger.annotations.ApiOperation;

/**
 * 居住证
 * 
 * @author zl 2018年7月20日 上午10:11:14
 *
 */
@RestController
@RequestMapping(value = "/residencePermit")
@CrossOrigin("*")
public class ResidencePermitController {

	private static final Logger logger = LoggerFactory
			.getLogger(ResidencePermitController.class);

	@Autowired
	private ResidencePermitService residencePermitService;

	/**
	 * 用户上传状态检测,是否可以上传
	 * @author zl 2018年7月23日 下午6:23:58
	 * @param param
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/stateTest", method = RequestMethod.POST)
	//@ResponseBody
	@ApiOperation(value = "上传填居住证资料前检测状态是否可以上传", httpMethod = "POST")
	public Object uploadMaterialTest(String param,HttpServletRequest request) {
		logger.info("进入[居住证] uploadMaterialTest()方法；入参param = " + param);
		return residencePermitService.uploadMaterialTest(param, request);
	}
	
	/**
	 * 用户上传居住证资料
	 * @author zl 2018年7月20日 上午9:36:07
	 * @param param
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/uploadMaterial", method = RequestMethod.POST)
	@ApiOperation(value = "上传填写的居住证资料", httpMethod = "POST")
	public Object uploadMaterial(String param,HttpServletRequest request) {
		logger.info("进入[居住证] uploadMaterial()方法；入参param = " + param);
		return residencePermitService.uploadMaterial(param, request);
	}

	/**
	 * 办事人员查询居住证办理信息(简要信息列表)，查询条件：身份证号  居民姓名（模糊）办理状态
	 * @author zl 2018年7月23日 下午8:28:23
	 * @param param
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/residencePermitList", method = RequestMethod.POST)
	@ApiOperation(value = "办事人员查询居住证办理信息列表")
	public Object queryResidencePermit(String param,HttpServletRequest request) {
		logger.info("进入[居住证] queryResidencePermit()方法；入参param = " + param);
		return residencePermitService.residencePermitList (param,request);
	}

	@RequestMapping(value = "/residencePermitDetail", method = RequestMethod.POST)
	@ApiOperation(value = "办事人员查询居住证办理详细信息")
	public Object residencePermitDetail(String param,HttpServletRequest request) {
		logger.info("进入[居住证] residencePermitDetail()方法；入参param = " + param);
		return residencePermitService.residencePermitDetail (param,request);
	}
}
